ActiveConnection Property

       

Returns or sets an object reference indicating the connection this query should be associated with.

Syntax

object.ActiveConnection [= value]

The ActiveConnection property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value An expression that evaluates to a valid rdoConnection or derived object. Value defaults to the rdoConnection used to create the object or Nothing.

Remarks

The ActiveConnection property holds a reference to the connection associated with the rdoQuery or rdoResultset object. All database statements executed by the object are executed against this connection.

When working with an rdoQuery object, the ActiveConnection property can be set to Nothing which dissociates the object from a specific connection. You can subsequently re-associate the rdoQuery object to another rdoConnection object by setting the ActiveConnection object. Using this technique, a query can be executed against a set of connections.

When working with the rdoResultset object and the Client Batch cursor library, you can set the ActiveConnection property to Nothing. In this case, if the result set is created with a static cursor and the rdConcurBatch concurrency option, the rdoResultset data is still available and you are free to make changes or additions to the result set. Once you set the ActiveConnection to an open rdoConnection object, you can use the BatchUpdate method to post these changes to the remote database.